#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
#include <signal.h>

void myprint(int sign)
{
    printf("hello\n");
}
int main(int argc, char const *argv[])
{
    struct itimerval it, oldit;
    signal(SIGALRM, myprint);
    it.it_value.tv_sec = 1;
    it.it_value.tv_usec = 0;
    it.it_interval.tv_sec = 3;
    it.it_interval.tv_usec = 0;
    if(setitimer(ITIMER_REAL,&it,&oldit)){
        perror("setitimer failed");
    }
    while(1)
        ;
    
    return 0;
}
